package cn.bytecollege.merchant.service;

import cn.bytecollege.common.entity.Address;
import cn.bytecollege.common.entity.User;
import cn.bytecollege.user.dao.AddressDao;

import java.util.List;

public class AddressService {
    AddressDao addressDao=null;
    public AddressService(){
        addressDao=new AddressDao();
    }
    /**
     * 增加地址
     */

    public int save(Address address) {
        return addressDao.save(address);

    }
    /**
     * 根据用户姓名查找用户Id
     */
    public User findByname(String name){
        return  addressDao.findByname(name);
    }

    /**
     * 根据用户Id分页查询出其创建的所有地址
     */
    public List<Address> findlistById(Integer ID){
        return  addressDao.findlistById(ID);
    }

    /**
     * 根据地址Id查询出当前地址信息
     */

    public Address findById(Integer ID) {
        return addressDao.findById(ID);
    }
    /**
     * 根据地址ID删除地址
     */

    public int deleteById(Integer Id) {
        return addressDao.deleteById(Id);
    }

    /**
     * 根据提交地址进行修改
     * @param address
     * @return
     */

    public int update(Address address) {
        return addressDao.update(address);
    }








}
